import axios from '@/common/axios';
import { API_URL } from '@/common/constants';

export const queryMbomList = async (json) => {
  const { data } = await axios.post(`${API_URL}mbom/queryMbomList`, json);
  return data;
};

export const exportData = async (json) => {
  const { data } = await axios.post(`${API_URL}mbom/exportData`, json, {
    responseType: 'blob',
  });
  return data;
};

export const queryMbom = async (json) => {
  const { data } = await axios.post(`${API_URL}mbom/queryMbom`, json);
  return data;
};

export const saveMbom = async (json) => {
  const { data } = await axios.post(`${API_URL}mbom/saveMbom`, json);
  return data;
};

export const delMbom = async (FID, FNumber, entryId) => {
  const { data } = await axios.get(`${API_URL}mbom/delMbom/${FID}/${FNumber}/${entryId}`);
  return data;
};
